package com.huawei.esdk.tp.device.aa;

import org.apache.log4j.Logger;

import com.huawei.esdk.platform.commu.itf.ISDKProtocolAdapter;
import com.huawei.esdk.platform.exception.ProtocolAdapterException;

public class TE30V1R1C01AAService extends TerminalAAService
{
    private static final Logger LOGGER = Logger
            .getLogger(TE30V1R1C01AAService.class);

    public TE30V1R1C01AAService(ISDKProtocolAdapter protocolAdapter)
    {
        super(protocolAdapter);
    }

    public String terminalAuthorize(String userName, String password)
            throws ProtocolAdapterException
    {
        LOGGER.debug("TE30Authorize process start");
        
        LOGGER.debug("userName=" + userName);
        
        
        String requestMessage = "{\"user\"" + ":" + "\"" + userName + "\""
                + "," + "\"password\"" + ":" + "\"" + password + "\"}";
        
        String logMessage = "{\"user\"" + ":" + "\"" + userName + "\""
                + "," + "\"password\"" + ":" + "\"******\"}";
        LOGGER.debug("request Json Message = " + logMessage);
        
        String response = sendJsonMessage(requestMessage,
                "WEB_RequestCertificateAPI");

        LOGGER.debug("TerminalAuthorize process end");
        return response;
    }
}
